package com.movie.controller;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.movie.dao.MovieDao;
import com.movie.dao.UserDao;
import com.movie.dao.impl.MovieDaoImpl;
import com.movie.entity.User;
import com.movie.service.UserService;
/**
 * 显示首页电影的列表
* @ClassName: IndexView 
* @Description: TODO(描述这个类的作用) 
* @author 左岩
* @date 2018年12月17日 下午4:34:54 
*
 */

@WebServlet(urlPatterns="/index")
public class IndexView extends HttpServlet {
	private static final long serialVersionUID = 1L;
       

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		MovieDao movieDao = new MovieDaoImpl();
		List<Map<String,Object>> movieList = movieDao.getAllMovieAndImage();
		request.setAttribute("movieList",movieList);
		request.getRequestDispatcher("/index.jsp").forward(request, response);
		
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
